﻿using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Security.Principal;
using System.Text;
using System.Threading.Tasks;

namespace SJC.Services
{
    public class AdminsTService
    {
        //登录-->查询           若查询成功返回1
        public static int countByAccount(string account, string password)
        {
            string sql = "select count(*) from AdminsT where account='" + account + "' and pwd='" + password + "' ";
            return DBHelper.Cha_a(sql);
        }
        public static string selectAccountById(int adminId)
        {
            string account = null;
            string sql = "select account from adminst where adminid='" + adminId + "'";
            SqlDataReader r = DBHelper.Cha_b(sql);
            while (r.Read())
            {
                 account= r["Account"].ToString();
            }
            r.Close();
            return account;
        }

    }
}
